package com.fengmi.uc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fengmi.interceptor.UserInfoInterceptor;
import com.fengmi.uc.entity.MallAddress;
import com.fengmi.uc.mapper.MallAddressMapper;
import com.fengmi.uc.service.IMallAddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhuxm
 * @since 2022-03-14
 */
@Service
public class MallAddressServiceImpl extends ServiceImpl<MallAddressMapper, MallAddress> implements IMallAddressService {


    @Override
    public List<MallAddress> listAddress() {

        //获取用户id
        String userId = UserInfoInterceptor.getUserInfo().getUserId();

        QueryWrapper<MallAddress> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("loc_member_id",userId);

        return  this.baseMapper.selectList(queryWrapper);


    }
}
